/*
 * @Author: Yeong Lee
 * @Date: 2021-02-15 00:55:21
 * @Last Modified by: Yeong Lee
 * @Last Modified time: 2021-03-04 00:09:30
 */
import React, { Component } from 'react';
// import { connect } from 'react-redux';
import {
  BrowserRouter as Router,
  Switch,
  Route,
} from 'react-router-dom';

import Home from '@pages/home/index/index.jsx';
import About from '@pages/home/about/index.jsx';
import Cases from '@pages/home/cases/index.jsx';
import Contact from '@pages/home/contact/index.jsx';
import News from '@pages/home/news/index.jsx';
import NewsRead from '@pages/home/news/read.jsx';
import NoMatch from '@pages/not-match.jsx';

// @connect((state) => ({state,})) // @connect 装饰器只能装饰类组件，使用useSelector替代
export default () => (
  <Router>
    <Switch>
      <Route path="/news/:newsId" component={NewsRead} />
      <Route path="/news" component={News}>
      </Route>
      <Route path="/contact" component={Contact} />
      <Route path="/cases" component={Cases} />
      <Route path="/about" component={About} />
      <Route path="/" component={Home} />
      <Route component={NoMatch} />
    </Switch>
  </Router>
);

